<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>shark::LRUCache&lt; T &gt; Class Template Reference</title>
<script type="text/javaScript" src="search/search.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js"></script>
<script src="../../mlstyle.js"></script>
<link href="../css/besser.css" rel="stylesheet" type="text/css"/>
</head>
<!-- pretty cool: each body gets an id tag which is the basename of the web page  -->
<!--              and allows for page-specific CSS. this is client-side scripted, -->
<!--              so the id will not yet show up in the served source code -->
<script type="text/javascript">
    jQuery(document).ready(function () {
        var url = jQuery(location).attr('href');
        var pname = url.substr(url.lastIndexOf("/")+1, url.lastIndexOf(".")-url.lastIndexOf("/")-1);
        jQuery('#this_url').html('<strong>' + pname + '</strong>');
        jQuery('body').attr('id', pname);
    });
</script>
<body>
    <div id="shark_old">
        <div id="wrap">
            <div id="header">
                <div id="site-name"><a href="../../sphinx_pages/build/html/index.html">Shark machine learning library</a></div>
                <ul id="nav">
                    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/installation.html">Installation</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/tutorials/tutorials.html">Tutorials</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/benchmark.html">Benchmarks</a>
                    </li>
                    <li class="active">
                        <a href="classes.html">Documentation</a>
                        <ul>
                            <li class="first"></li>
                            <li><a href="../../sphinx_pages/build/html/rest_sources/quickref/quickref.html">Quick references</a></li>
                            <li><a href="classes.html">Class list</a></li>
                            <li class="last"><a href="group__shark__globals.html">Global functions</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
<div id="doxywrapper">
<!--
    <div id="global_doxytitle">Doxygen<br>Documentation:</div>
-->
    <div id="navrow_wrapper">
<!-- Generated by Doxygen 1.9.8 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceshark.html">shark</a></li><li class="navelem"><a class="el" href="classshark_1_1_l_r_u_cache.html">LRUCache</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="classshark_1_1_l_r_u_cache-members.html">List of all members</a> &#124;
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle"><div class="title">shark::LRUCache&lt; T &gt; Class Template Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Implements an LRU-Caching Strategy for arbitrary Cache-Lines.  
 <a href="classshark_1_1_l_r_u_cache.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_l_r_u_cache_8h_source.html">shark/LinAlg/LRUCache.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad2dd07a0ed9d6628dd54328e9131352b" id="r_ad2dd07a0ed9d6628dd54328e9131352b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_l_r_u_cache.html#ad2dd07a0ed9d6628dd54328e9131352b">LRUCache</a> (std::size_t lines, std::size_t cachesize=0x4000000)</td></tr>
<tr class="memdesc:ad2dd07a0ed9d6628dd54328e9131352b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a cache with a given maximum index "lines" and a given maximum cache size.  <br /></td></tr>
<tr class="separator:ad2dd07a0ed9d6628dd54328e9131352b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a353c4c3ab265ca17f90686466fc99d1e" id="r_a353c4c3ab265ca17f90686466fc99d1e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_l_r_u_cache.html#a353c4c3ab265ca17f90686466fc99d1e">~LRUCache</a> ()</td></tr>
<tr class="separator:a353c4c3ab265ca17f90686466fc99d1e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa7fe0128f8b11bfab3e6e89d0544b4dd" id="r_aa7fe0128f8b11bfab3e6e89d0544b4dd"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_l_r_u_cache.html#aa7fe0128f8b11bfab3e6e89d0544b4dd">isCached</a> (std::size_t i) const</td></tr>
<tr class="memdesc:aa7fe0128f8b11bfab3e6e89d0544b4dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the line is cached.  <br /></td></tr>
<tr class="separator:aa7fe0128f8b11bfab3e6e89d0544b4dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad8cae64a351bdef5e03976d1e5176072" id="r_ad8cae64a351bdef5e03976d1e5176072"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_l_r_u_cache.html#ad8cae64a351bdef5e03976d1e5176072">lineLength</a> (std::size_t i) const</td></tr>
<tr class="memdesc:ad8cae64a351bdef5e03976d1e5176072"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the size of the cached line.  <br /></td></tr>
<tr class="separator:ad8cae64a351bdef5e03976d1e5176072"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a02ecc15b8471e026cfe4a5f93bf66b49" id="r_a02ecc15b8471e026cfe4a5f93bf66b49"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_l_r_u_cache.html#a02ecc15b8471e026cfe4a5f93bf66b49">cachedLines</a> () const</td></tr>
<tr class="memdesc:a02ecc15b8471e026cfe4a5f93bf66b49"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of lines currently allocated.  <br /></td></tr>
<tr class="separator:a02ecc15b8471e026cfe4a5f93bf66b49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d1d221a9216657a86b799233d80c1af" id="r_a1d1d221a9216657a86b799233d80c1af"><td class="memItemLeft" align="right" valign="top">T *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_l_r_u_cache.html#a1d1d221a9216657a86b799233d80c1af">getCacheLine</a> (std::size_t i, std::size_t <a class="el" href="classshark_1_1_l_r_u_cache.html#ae089a1943125f1be80d521caaefdfd0e">size</a>)</td></tr>
<tr class="memdesc:a1d1d221a9216657a86b799233d80c1af"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the line with index i with the correct size.  <br /></td></tr>
<tr class="separator:a1d1d221a9216657a86b799233d80c1af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2848536687dec954b5ec1cea247866eb" id="r_a2848536687dec954b5ec1cea247866eb"><td class="memItemLeft" align="right" valign="top">T *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_l_r_u_cache.html#a2848536687dec954b5ec1cea247866eb">getLinePointer</a> (std::size_t i)</td></tr>
<tr class="memdesc:a2848536687dec954b5ec1cea247866eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Just returns the pointer to the i-th line without affcting cache at all.  <br /></td></tr>
<tr class="separator:a2848536687dec954b5ec1cea247866eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad55c9f2d4c55fd38e494ce98907851c" id="r_aad55c9f2d4c55fd38e494ce98907851c"><td class="memItemLeft" align="right" valign="top">T const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_l_r_u_cache.html#aad55c9f2d4c55fd38e494ce98907851c">getLinePointer</a> (std::size_t i) const</td></tr>
<tr class="memdesc:aad55c9f2d4c55fd38e494ce98907851c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Just returns the pointer to the i-th line without affcting cache at all.  <br /></td></tr>
<tr class="separator:aad55c9f2d4c55fd38e494ce98907851c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a17d6a25d7e772893c10ec0cdd3f8670f" id="r_a17d6a25d7e772893c10ec0cdd3f8670f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_l_r_u_cache.html#a17d6a25d7e772893c10ec0cdd3f8670f">resizeLine</a> (std::size_t i, std::size_t <a class="el" href="classshark_1_1_l_r_u_cache.html#ae089a1943125f1be80d521caaefdfd0e">size</a>)</td></tr>
<tr class="memdesc:a17d6a25d7e772893c10ec0cdd3f8670f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resizes a line while retaining the data stored inside it.  <br /></td></tr>
<tr class="separator:a17d6a25d7e772893c10ec0cdd3f8670f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a738129f952a28aa14f35c952079d0a7e" id="r_a738129f952a28aa14f35c952079d0a7e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_l_r_u_cache.html#a738129f952a28aa14f35c952079d0a7e">markLineForDeletion</a> (std::size_t i)</td></tr>
<tr class="memdesc:a738129f952a28aa14f35c952079d0a7e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Marks cache line i for deletion, that is the next time memory is needed, this line will be freed.  <br /></td></tr>
<tr class="separator:a738129f952a28aa14f35c952079d0a7e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af995657d3a4cd3c7c85550e0fb056985" id="r_af995657d3a4cd3c7c85550e0fb056985"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_l_r_u_cache.html#af995657d3a4cd3c7c85550e0fb056985">swapLineIndices</a> (std::size_t i, std::size_t j)</td></tr>
<tr class="memdesc:af995657d3a4cd3c7c85550e0fb056985"><td class="mdescLeft">&#160;</td><td class="mdescRight">swaps index of lines i and j.  <br /></td></tr>
<tr class="separator:af995657d3a4cd3c7c85550e0fb056985"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae089a1943125f1be80d521caaefdfd0e" id="r_ae089a1943125f1be80d521caaefdfd0e"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_l_r_u_cache.html#ae089a1943125f1be80d521caaefdfd0e">size</a> () const</td></tr>
<tr class="separator:ae089a1943125f1be80d521caaefdfd0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a96690c348d7b3e7b45f5efbb093da7e6" id="r_a96690c348d7b3e7b45f5efbb093da7e6"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_l_r_u_cache.html#a96690c348d7b3e7b45f5efbb093da7e6">listIndex</a> (std::size_t i) const</td></tr>
<tr class="separator:a96690c348d7b3e7b45f5efbb093da7e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a54c4f8d27361379cc684a5f3bd0ad2c5" id="r_a54c4f8d27361379cc684a5f3bd0ad2c5"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_l_r_u_cache.html#a54c4f8d27361379cc684a5f3bd0ad2c5">maxSize</a> () const</td></tr>
<tr class="separator:a54c4f8d27361379cc684a5f3bd0ad2c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afd6ed6c3442f200616f4c7d4cee32144" id="r_afd6ed6c3442f200616f4c7d4cee32144"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_l_r_u_cache.html#afd6ed6c3442f200616f4c7d4cee32144">clear</a> ()</td></tr>
<tr class="memdesc:afd6ed6c3442f200616f4c7d4cee32144"><td class="mdescLeft">&#160;</td><td class="mdescRight">empty cache  <br /></td></tr>
<tr class="separator:afd6ed6c3442f200616f4c7d4cee32144"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;class T&gt;<br />
class shark::LRUCache&lt; T &gt;</div><p>Implements an LRU-Caching Strategy for arbitrary Cache-Lines. </p>
<p>Low Level Cache which stores cache lines, arrays of T[size] where size is a variable length for every cache line. Every line is associated with some index 0&lt;i &lt; max. It is assumed that not all cache lines can be stored at the same time, but only a (small) subset. The size of the cache is bounded by the summed length of all cache lines, that means that when the lines are very short, the cache can store more lines. If the cache is full and another line needs to be accessed, or an existing line needs to be resized, cache lines need to be freed. This cache uses an Least-Recently-Used strategy. The cache maintains a list. Everytime a cacheline is accessed, it moves to the front of the list. When a line is freed the end of the list is chosen. </p>

<p class="definition">Definition at line <a class="el" href="_l_r_u_cache_8h_source.html#l00055">55</a> of file <a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ad2dd07a0ed9d6628dd54328e9131352b" name="ad2dd07a0ed9d6628dd54328e9131352b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad2dd07a0ed9d6628dd54328e9131352b">&#9670;&#160;</a></span>LRUCache()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classshark_1_1_l_r_u_cache.html">shark::LRUCache</a>&lt; T &gt;::LRUCache </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>lines</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>cachesize</em> = <code>0x4000000</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Creates a cache with a given maximum index "lines" and a given maximum cache size. </p>

<p class="definition">Definition at line <a class="el" href="_l_r_u_cache_8h_source.html#l00065">65</a> of file <a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a>.</p>

</div>
</div>
<a id="a353c4c3ab265ca17f90686466fc99d1e" name="a353c4c3ab265ca17f90686466fc99d1e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a353c4c3ab265ca17f90686466fc99d1e">&#9670;&#160;</a></span>~LRUCache()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classshark_1_1_l_r_u_cache.html">shark::LRUCache</a>&lt; T &gt;::~<a class="el" href="classshark_1_1_l_r_u_cache.html">LRUCache</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_l_r_u_cache_8h_source.html#l00070">70</a> of file <a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_l_r_u_cache.html#afd6ed6c3442f200616f4c7d4cee32144">shark::LRUCache&lt; T &gt;::clear()</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a02ecc15b8471e026cfe4a5f93bf66b49" name="a02ecc15b8471e026cfe4a5f93bf66b49"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a02ecc15b8471e026cfe4a5f93bf66b49">&#9670;&#160;</a></span>cachedLines()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t <a class="el" href="classshark_1_1_l_r_u_cache.html">shark::LRUCache</a>&lt; T &gt;::cachedLines </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the number of lines currently allocated. </p>

<p class="definition">Definition at line <a class="el" href="_l_r_u_cache_8h_source.html#l00084">84</a> of file <a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a>.</p>

</div>
</div>
<a id="afd6ed6c3442f200616f4c7d4cee32144" name="afd6ed6c3442f200616f4c7d4cee32144"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afd6ed6c3442f200616f4c7d4cee32144">&#9670;&#160;</a></span>clear()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_l_r_u_cache.html">shark::LRUCache</a>&lt; T &gt;::clear </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>empty cache </p>

<p class="definition">Definition at line <a class="el" href="_l_r_u_cache_8h_source.html#l00197">197</a> of file <a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_cached_matrix.html#ae000f8c2a306080058593b6ade36db12">shark::CachedMatrix&lt; Matrix &gt;::clear()</a>, and <a class="el" href="classshark_1_1_l_r_u_cache.html#a353c4c3ab265ca17f90686466fc99d1e">shark::LRUCache&lt; T &gt;::~LRUCache()</a>.</p>

</div>
</div>
<a id="a1d1d221a9216657a86b799233d80c1af" name="a1d1d221a9216657a86b799233d80c1af"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d1d221a9216657a86b799233d80c1af">&#9670;&#160;</a></span>getCacheLine()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">T * <a class="el" href="classshark_1_1_l_r_u_cache.html">shark::LRUCache</a>&lt; T &gt;::getCacheLine </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>i</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the line with index i with the correct size. </p>
<p>If the line is not cached, it is created with the exact size. if it is cached and is at least as big, it is returned unchanged. otherwise it is resized to the proper size and the old values are kept. </p>

<p class="definition">Definition at line <a class="el" href="_l_r_u_cache_8h_source.html#l00093">93</a> of file <a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_l_r_u_cache.html#aa7fe0128f8b11bfab3e6e89d0544b4dd">shark::LRUCache&lt; T &gt;::isCached()</a>, <a class="el" href="classshark_1_1_l_r_u_cache.html#a17d6a25d7e772893c10ec0cdd3f8670f">shark::LRUCache&lt; T &gt;::resizeLine()</a>, and <a class="el" href="classshark_1_1_l_r_u_cache.html#ae089a1943125f1be80d521caaefdfd0e">shark::LRUCache&lt; T &gt;::size()</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_cached_matrix.html#a5bbb64e31e0b33409f9fe76b939d735e">shark::CachedMatrix&lt; Matrix &gt;::row()</a>.</p>

</div>
</div>
<a id="a2848536687dec954b5ec1cea247866eb" name="a2848536687dec954b5ec1cea247866eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2848536687dec954b5ec1cea247866eb">&#9670;&#160;</a></span>getLinePointer() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">T * <a class="el" href="classshark_1_1_l_r_u_cache.html">shark::LRUCache</a>&lt; T &gt;::getLinePointer </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Just returns the pointer to the i-th line without affcting cache at all. </p>

<p class="definition">Definition at line <a class="el" href="_l_r_u_cache_8h_source.html#l00108">108</a> of file <a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_cached_matrix.html#aad2529155a7ebf9ef3de0cacf46956d0">shark::CachedMatrix&lt; Matrix &gt;::flipColumnsAndRows()</a>, and <a class="el" href="classshark_1_1_cached_matrix.html#a09afc06315ddf58b64497d67886cb805">shark::CachedMatrix&lt; Matrix &gt;::row()</a>.</p>

</div>
</div>
<a id="aad55c9f2d4c55fd38e494ce98907851c" name="aad55c9f2d4c55fd38e494ce98907851c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aad55c9f2d4c55fd38e494ce98907851c">&#9670;&#160;</a></span>getLinePointer() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">T const  * <a class="el" href="classshark_1_1_l_r_u_cache.html">shark::LRUCache</a>&lt; T &gt;::getLinePointer </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Just returns the pointer to the i-th line without affcting cache at all. </p>

<p class="definition">Definition at line <a class="el" href="_l_r_u_cache_8h_source.html#l00113">113</a> of file <a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a>.</p>

</div>
</div>
<a id="aa7fe0128f8b11bfab3e6e89d0544b4dd" name="aa7fe0128f8b11bfab3e6e89d0544b4dd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa7fe0128f8b11bfab3e6e89d0544b4dd">&#9670;&#160;</a></span>isCached()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classshark_1_1_l_r_u_cache.html">shark::LRUCache</a>&lt; T &gt;::isCached </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns true if the line is cached. </p>

<p class="definition">Definition at line <a class="el" href="_l_r_u_cache_8h_source.html#l00075">75</a> of file <a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_l_r_u_cache.html#a1d1d221a9216657a86b799233d80c1af">shark::LRUCache&lt; T &gt;::getCacheLine()</a>, <a class="el" href="classshark_1_1_cached_matrix.html#a64a43716271f03ac6415a5cecc4c1e5d">shark::CachedMatrix&lt; Matrix &gt;::isCached()</a>, <a class="el" href="classshark_1_1_l_r_u_cache.html#a738129f952a28aa14f35c952079d0a7e">shark::LRUCache&lt; T &gt;::markLineForDeletion()</a>, and <a class="el" href="classshark_1_1_l_r_u_cache.html#af995657d3a4cd3c7c85550e0fb056985">shark::LRUCache&lt; T &gt;::swapLineIndices()</a>.</p>

</div>
</div>
<a id="ad8cae64a351bdef5e03976d1e5176072" name="ad8cae64a351bdef5e03976d1e5176072"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad8cae64a351bdef5e03976d1e5176072">&#9670;&#160;</a></span>lineLength()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t <a class="el" href="classshark_1_1_l_r_u_cache.html">shark::LRUCache</a>&lt; T &gt;::lineLength </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the size of the cached line. </p>

<p class="definition">Definition at line <a class="el" href="_l_r_u_cache_8h_source.html#l00079">79</a> of file <a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_cached_matrix.html#aad2529155a7ebf9ef3de0cacf46956d0">shark::CachedMatrix&lt; Matrix &gt;::flipColumnsAndRows()</a>, <a class="el" href="classshark_1_1_cached_matrix.html#a752febb4f36dd418bce1e8eeefbc549a">shark::CachedMatrix&lt; Matrix &gt;::getCacheRowSize()</a>, <a class="el" href="classshark_1_1_cached_matrix.html#a5bbb64e31e0b33409f9fe76b939d735e">shark::CachedMatrix&lt; Matrix &gt;::row()</a>, and <a class="el" href="classshark_1_1_cached_matrix.html#a09afc06315ddf58b64497d67886cb805">shark::CachedMatrix&lt; Matrix &gt;::row()</a>.</p>

</div>
</div>
<a id="a96690c348d7b3e7b45f5efbb093da7e6" name="a96690c348d7b3e7b45f5efbb093da7e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a96690c348d7b3e7b45f5efbb093da7e6">&#9670;&#160;</a></span>listIndex()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t <a class="el" href="classshark_1_1_l_r_u_cache.html">shark::LRUCache</a>&lt; T &gt;::listIndex </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_l_r_u_cache_8h_source.html#l00187">187</a> of file <a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a>.</p>

</div>
</div>
<a id="a738129f952a28aa14f35c952079d0a7e" name="a738129f952a28aa14f35c952079d0a7e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a738129f952a28aa14f35c952079d0a7e">&#9670;&#160;</a></span>markLineForDeletion()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_l_r_u_cache.html">shark::LRUCache</a>&lt; T &gt;::markLineForDeletion </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Marks cache line i for deletion, that is the next time memory is needed, this line will be freed. </p>

<p class="definition">Definition at line <a class="el" href="_l_r_u_cache_8h_source.html#l00125">125</a> of file <a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_l_r_u_cache.html#aa7fe0128f8b11bfab3e6e89d0544b4dd">shark::LRUCache&lt; T &gt;::isCached()</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_cached_matrix.html#af653442cee95203259116e1f4605ca35">shark::CachedMatrix&lt; Matrix &gt;::setMaxCachedIndex()</a>.</p>

</div>
</div>
<a id="a54c4f8d27361379cc684a5f3bd0ad2c5" name="a54c4f8d27361379cc684a5f3bd0ad2c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a54c4f8d27361379cc684a5f3bd0ad2c5">&#9670;&#160;</a></span>maxSize()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t <a class="el" href="classshark_1_1_l_r_u_cache.html">shark::LRUCache</a>&lt; T &gt;::maxSize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_l_r_u_cache_8h_source.html#l00192">192</a> of file <a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_cached_matrix.html#a4e3b71aa789c0cb4036f4bbf76313f9a">shark::CachedMatrix&lt; Matrix &gt;::getMaxCacheSize()</a>.</p>

</div>
</div>
<a id="a17d6a25d7e772893c10ec0cdd3f8670f" name="a17d6a25d7e772893c10ec0cdd3f8670f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a17d6a25d7e772893c10ec0cdd3f8670f">&#9670;&#160;</a></span>resizeLine()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_l_r_u_cache.html">shark::LRUCache</a>&lt; T &gt;::resizeLine </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>i</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Resizes a line while retaining the data stored inside it. </p>
<p>if the new size is smaller than the old, only the first size entries are saved. </p>

<p class="definition">Definition at line <a class="el" href="_l_r_u_cache_8h_source.html#l00120">120</a> of file <a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_l_r_u_cache.html#a17d6a25d7e772893c10ec0cdd3f8670f">shark::LRUCache&lt; T &gt;::resizeLine()</a>, and <a class="el" href="classshark_1_1_l_r_u_cache.html#ae089a1943125f1be80d521caaefdfd0e">shark::LRUCache&lt; T &gt;::size()</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_l_r_u_cache.html#a1d1d221a9216657a86b799233d80c1af">shark::LRUCache&lt; T &gt;::getCacheLine()</a>, and <a class="el" href="classshark_1_1_l_r_u_cache.html#a17d6a25d7e772893c10ec0cdd3f8670f">shark::LRUCache&lt; T &gt;::resizeLine()</a>.</p>

</div>
</div>
<a id="ae089a1943125f1be80d521caaefdfd0e" name="ae089a1943125f1be80d521caaefdfd0e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae089a1943125f1be80d521caaefdfd0e">&#9670;&#160;</a></span>size()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t <a class="el" href="classshark_1_1_l_r_u_cache.html">shark::LRUCache</a>&lt; T &gt;::size </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_l_r_u_cache_8h_source.html#l00183">183</a> of file <a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_l_r_u_cache.html#a1d1d221a9216657a86b799233d80c1af">shark::LRUCache&lt; T &gt;::getCacheLine()</a>, <a class="el" href="classshark_1_1_cached_matrix.html#a53c29c87d1c481a928abf63171d45fbd">shark::CachedMatrix&lt; Matrix &gt;::getCacheSize()</a>, and <a class="el" href="classshark_1_1_l_r_u_cache.html#a17d6a25d7e772893c10ec0cdd3f8670f">shark::LRUCache&lt; T &gt;::resizeLine()</a>.</p>

</div>
</div>
<a id="af995657d3a4cd3c7c85550e0fb056985" name="af995657d3a4cd3c7c85550e0fb056985"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af995657d3a4cd3c7c85550e0fb056985">&#9670;&#160;</a></span>swapLineIndices()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_l_r_u_cache.html">shark::LRUCache</a>&lt; T &gt;::swapLineIndices </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>i</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>j</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>swaps index of lines i and j. </p>

<p class="definition">Definition at line <a class="el" href="_l_r_u_cache_8h_source.html#l00133">133</a> of file <a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_l_r_u_cache.html#aa7fe0128f8b11bfab3e6e89d0544b4dd">shark::LRUCache&lt; T &gt;::isCached()</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_cached_matrix.html#aad2529155a7ebf9ef3de0cacf46956d0">shark::CachedMatrix&lt; Matrix &gt;::flipColumnsAndRows()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/shark/LinAlg/<a class="el" href="_l_r_u_cache_8h_source.html">LRUCache.h</a></li>
</ul>
</div><!-- contents -->
</div>
</body>
</html>
